#include "eeprom.h"
static void Delay10ms(void)	//@12.000MHz
{
	unsigned char data i, j;

	i = 117;
	j = 184;
	do
	{
		while (--j);
	} while (--i);
}

void write(unsigned char addr, unsigned char dat)
{
	I2CStart();
	I2CSendByte(0xa0);
	I2CWaitAck();
	I2CSendByte(addr);
	I2CWaitAck();
	I2CSendByte(dat);
	I2CWaitAck();
	I2CStop();
	Delay10ms();
}

//unsigned char read(unsigned char addr)
//{
//	unsigned char dat;
//	I2CStart();
//	I2CSendByte(0xa0);
//	I2CWaitAck();
//	I2CSendByte(addr);
//	I2CWaitAck();
//	I2CStart();
//	I2CSendByte(0xa1);
//	I2CWaitAck();
//	dat = I2CReceiveByte();
//	I2CSendAck(1);
//	I2CStop();
//	return dat;
//}